package com.example.springboottest.example.thread;

import java.util.concurrent.TimeUnit;

public class TestSyncService {
    public synchronized void helloSync(String name) {
        System.out.println("helloSync " + name);
        try {
            TimeUnit.SECONDS.sleep(5);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public synchronized void helloSync2(String name) {
        System.out.println("helloSync2 " + name);
        try {
            TimeUnit.SECONDS.sleep(5);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
